﻿<template>
    <div class="schoolBack">
        <h2>学校名称:{{name}}</h2>
        <h2>学校地址:{{address}}</h2>
        <button @click="sendSchoolName">把学校名给自己的父组件App</button>
    </div>
</template>

<script>
    export default{
        name: 'School',
        components:{},
        props:['getSchoolName'],
        data(){
            return{
                name: 'bilibili',
                address: '魔都'
            }
        },
        methods: {
            sendSchoolName(){
                this.getSchoolName(this.name)      
            }
        },
    }
</script>

<style scoped>
    .schoolBack{
        background-color: skyblue;
    }
</style>